//
//  GradientTipView.swift
//  SCA
//
//  Created by tjun on 2025/9/20.
//

import UIKit

class GradientTipView: GradientView {
    
    let text: String
    init(text: String) {
        self.text = text
        super.init(frame: .zero)
        
        colors = [UIColorMake(0x05D4FC), UIColorMake(0xBE0DEF), UIColorMake(0xF202D3)]
        locations = [0, 0.5, 1]
        setStartPoint(CGPoint(x: 0, y: 0.5), endPoint: CGPointMake(1, 0.5))
        isGradientBorder = true
        cornerRadius = AppStyle.cornerRadius.normal
        borderWidth = 1

        let scrollableView = ScrollableLabelView().addTo(self)
        scrollableView.text = text
        scrollableView.font = UIFont.systemFont(ofSize: 12)
        scrollableView.textColor = .white
        scrollableView.icon = UIImage(named: "warningIcon")
        scrollableView.snp.makeConstraints { make in
            make.edges.equalTo(self)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
